home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1495 / text0000.txt < prev   
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  34 lines

  1. In a message of 17 Jan 96 Kenneth C. Nilsen wrote to All:
  2.  
  3.  UV>>>   oldfunc=SetFunction(library,oldFuncOffset,newFuncPtr)
  4.  UV>>>   what is oldFuncOffset?
  5.  >> It is the offset in the library that you would jump to (in assembler) to
  6.  >> call the library function. For example, the Open() function in dos.library
  7.  >> has an offset of -30.
  8.  
  9.  KCN> No no, the oldFuncOffset is the actual pointer to the routine code of
  10.  KCN> the old function. This will let you use the old function in your new
  11.  KCN> routine:
  12.  
  13.  KCN> Here is an example. We have already opened intuition.library:
  14.  
  15.  KCN>         [...]
  16.  
  17.  KCN>         move.l        $4.w,a6
  18.  
  19.  KCN>         move.l        IntuitionBase(pc),a1
  20.  KCN>         move.l        #_LVOOpenWindowTagList,a0
  21.  KCN>         move.l        #OpenMywin,d0
  22.  KCN>         Call        SetFunction
  23.  KCN>         move.l        d0,OldFunc
  24.  KCN>         beq.w        Close
  25.  
  26. Isn't this what I said..? The constant "_LVOOpenWindowTagList" is set as
  27. -606. So the instruction "move.l #_LVOOpenWindowTagList,a0" puts the value
  28. -606 in to a0 (just like I said to put -30 in a0 for dos.library/Open()).
  29.  
  30. What's the difference?
  31.  
  32. .\dam.          [Team AMIGA]          //\ ad32@brighton.ac.uk \\/
  33.  
  34.